package pl.edu.agh.agents.agent;

public enum AgentTypes {
	// generic agent
	Autonomous("pl.edu.agh.agents.agent.AutonomousAgent"),
	Controlled("pl.edu.agh.agents.agent.ControlledAgent");

	// implementation class
	String className;

	private AgentTypes(String className) {
		this.className = className;
	}

	public Class<?> getAgentClass() {
		Class<?> c = null;

		try {
			c = Class.forName(className);
		} catch (ClassNotFoundException e) {
		}

		return c;
	}

	public static AgentTypes fromString(String className) {
		if (className != null) {
			for (AgentTypes at : AgentTypes.values()) {
				if (className.equalsIgnoreCase(at.className)) {
					return at;
				}
			}
		}
		return null;
	}
}